<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <script>
        // 获取元素
        const box = document.querySelector(".box")
        // 修改样式属性
        box.style.width = "300px" // 字符串带单位, 行内样式
        box.style.backgroundColor = "red" // 多个单词小驼峰
        box.style.border = "2px solid blue"
    </script>
</body>
</html>